Make window handle transparent
authorAlexander Larsson <alexl@redhat.com>
Mon, 5 Dec 2011 11:51:55 +0000 (12:51 +0100)
committerAlexander Larsson <alexl@redhat.com>
Mon, 5 Dec 2011 11:51:55 +0000 (12:51 +0100)
Instead of painting the window background on the grip_window we now
only paint it on the GtkWindow->window, and we make the grip_window
have a transparent background.

We can't really make transparent window handle background optional
via css atm, because the handle color is actually based on the
background color, so if that is set to transparent we won't draw
anything.

gtk/gtkwindow.c

index 50370a589aeadfd9f87cd3785a63e77d06b69957..fd23dd9a71d0cee5fed875d2c99adf7ce54f3814 100644 (file)
@@ -5521,6 +5521,7 @@ resize_grip_create_window (GtkWindow *window)
   GdkWindowAttr attributes;
   gint attributes_mask;
   GdkRectangle rect;
+  GdkRGBA transparent = {0, 0, 0, 0};
 
   priv = window->priv;
   widget = GTK_WIDGET (window);
@@ -5545,6 +5546,7 @@ resize_grip_create_window (GtkWindow *window)
   priv->grip_window = gdk_window_new (gtk_widget_get_window (widget),
                                       &attributes,
                                       attributes_mask);
+  gdk_window_set_background_rgba (priv->grip_window, &transparent);
 
   gdk_window_set_user_data (priv->grip_window, widget);
 
@@ -7440,7 +7442,8 @@ gtk_window_draw (GtkWidget *widget,
 
   gtk_style_context_save (context);
 
-  if (!gtk_widget_get_app_paintable (widget))
+  if (!gtk_widget_get_app_paintable (widget) &&
+      gtk_cairo_should_draw_window (cr, gtk_widget_get_window (widget)))
     {
       GtkStateFlags state;